Content starts here Creating XMLBean Support for Java Functions
This page last changed on Apr 22, 2008.

eDocs Home > BEA AquaLogic Data Services Platform Documentation > Data Services Developer's Guide > Contents

Creating XMLBean Support for Java Functions

Before you can create a Physical Data Service from Java functions, you need to create a .class file that contains XMLBean classes based on global elements and compiled versions of your Java functions. This topic describes how to create XMLBean classes based on a schema of your data.

Supported XMLBean Standards

Imported Java functions containing complex types must have a schema that conforms to one of the following XMLBean standards:

Version URL
Apache org.apache.xmlbeans
BEA
com.bea.xml

If your Java routines were compiled under previous versions, they will need to be recompiled before they can be imported.

The New Physical Data Service wizard requires that all the complex parameter or return types used by the functions correspond to XMLBean global element types whose content model is an anonymous type. Thus only functions referring to a top level element are imported.

Creating XMLBean Classes for Java Functions

This topic describes how to create XMLBean classes based on a schema of your data.

Creating a New Project

You need to create a new project to build the XMLBean classes.

New Project

To create a new project:

  1. Using WorkSpace Studio, create a new project by right-clicking in the Project Explorer and choosing New > Project in the menu. The New Project wizard is launched.
  2. Choose Java > Java Project and click Next.
  3. Type a name for the project and select Create separate source and output folders in the Project layout area.
  4. Click Finish. WorkSpace Studio creates a new project in the Project Explorer.
New Java Project Wizard

Enabling XMLBeans Builder

You need to enable the XMLBeans Builder in the project to allow it to create classes based on the Java source and XML schema files.

Project Properties

To enable XMLBeans Builder:

  1. Right-click the new project, and choose Properties from the menu. The Properties dialog appears.
  2. Click XMLBeans, select the Enable XMLBeans Builder checkbox, and click OK.
Enabling XMLBeans Builder

Importing Schema and Java Source Files

You need to import the schema files and Java source files into the project.

To import the schema and Java source files:

  • Copy the schema files representing the data used by the Java functions along with the Java source files into the src folder.

Creating a Project Reference

The final step involves creating a reference to your XMLBeans-based project from the dataspace in which you want to use the Java functions.

To create the project reference:

  1. Right-click the dataspace project in which you want to use the Java functions and choose Properties from the menu.
  2. Select Project References in the Properties dialog.
  3. Select your XMLBeans-based project, and click OK.

When your project is deployed, ALDSP does the following:

  • Rebuilds your XMLBeans-based project, if required, and generates a JAR file
  • Copies the JAR file to the DSP-INF/lib folder in the dataspace project
Project References

See Also

How Tos
Reference
Document generated by Confluence on Apr 28, 2008 15:54